﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using DAL;

namespace Prototype1
{
    public partial class FormNewUser : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            String username = tb_Username.Text;
            String password = tb_Password.Text;
            String firstName = tb_FirstName.Text;
            String lastName = tb_LastName.Text;
            String email = tb_Email.Text;

            User u = new User();
            u.email = email;
            u.Password = password;
            

            using (DataAccessDataContext dc = new DataAccessDataContext())
            {
                dc.Users.InsertOnSubmit(u);
                dc.SubmitChanges();
            }
        }
    }
}
